package pri.jz.keeper.db.convert

import android.graphics.Bitmap
import androidx.room.TypeConverter
import pri.jz.keeper.util.BitmapUtil

/**
 *Author by: JZ
 *Email: 2451756617@qq.com
 *PS:
 */
class BitmapConvert {

    @TypeConverter
    fun bitmapToString(bitmap: Bitmap?): String {
        bitmap?.let {
            return BitmapUtil.getTextFromBitmap(bitmap)
        }
        return ""
    }
    @TypeConverter
    fun stringToBitmap(string: String): Bitmap? {
        return BitmapUtil.getBitmapFromS(string)
    }
}